package src.io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/**
 * 转换流：InputStreamReader和OutputStreamWriter
 * 继承自Reader和Writer
 */
public class OSWDemo {
        public static void main(String[] args) throws IOException {
                FileOutputStream fos=new FileOutputStream("osw.txt");
                OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
                osw.write("我们之间的回忆，全部都小心的收集，");
                osw.write("我总是偷偷地哭泣，像倦鸟失了归期");
                System.out.println("写出完毕！");
                osw.close();//关闭高级流时会自动关闭低级流
        }
}
